
#[macro_use] extern crate rocket;


use std::fs::File;
use std::io::Read;
use lettre::Address;
use rocket::{Build, Rocket};
use 工具包::email::EmailSend;
use lettre::message::{Mailbox,IntoBody};
use crate::工具包::self_config::{ SelfConfig};
use crate::controller::API功能测试::File交互测试::File交互控制器::post_file_cs;
use crate::工具包::email::EmailBody::Html;
use crate::工具包::email::EmailBuilder;

use crate::工具包::self_config::start_config::start_config;
use crate::工具包::email::qq_email::QqEmail;

#[get("/")]
async fn get_f1() -> &'static str {
	"激励太没~"
}

#[rocket::main]
async fn main() {
	let (figment , cors)= start_config().await;
	let mut file = File::open("src/resource/template/email_cs.html").unwrap();
	let mut s = String::new();
	file.read_to_string(&mut s);
	
	QqEmail::new().to(vec![Mailbox::new(None,Address::new("1424343223","qq.com").unwrap())])
		.subject("我操")
		.body(Html(s)).send();

	// let rocket : Rocket<Build> = rocket::custom(figment)
	// 	.attach(cors)
	// 	.mount("/", routes![get_f1])
	// 	.mount("/cs",routes![post_file_cs]);
	//
	// rocket.launch().await;
}




//--mod--//
#[path= "./controller/mod.rs"]
mod controller;
#[path = "./工具包/mod.rs"]
mod 工具包;